package com.reggie.service.impl;

import com.reggie.mapper.DishFlavorMapper;
import com.reggie.pojo.DishFlavor;
import com.reggie.service.DishFlavorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DishFlavorServiceImpl implements DishFlavorService {
    @Autowired
    DishFlavorMapper dishFlavorMapper;

    @Override
    public boolean add(DishFlavor dishFlavor) {
        if (dishFlavorMapper.add(dishFlavor)==1) return true;
        return false;
    }

    @Override
    public List<DishFlavor> findByDishId(Long dishId) {
        List<DishFlavor> dishFlavorList = dishFlavorMapper.findByDishId(dishId, 0);
        return dishFlavorList;
    }
}
